PKUNZIP from VB4 V2 ******************* *1996 CB Unlimited* ******************* This sample code is a improvement on my original uploading It allows you to control PKUNZIP, and therefore unzip files, from VB4 Unlike the previous upload that couldn't close the window when the zipping was finished, this example can. There are two important functions in the bas module: ShellAndClose(CommandLine) 'Use this to shell to your dos program FindWindowLike 'This is called by ShellAndClose to find any windows with "Finished" in their title See KB article for more uses This example uses the fact that when a dos box in Windows 95 has finished the title changes to "Finished - ....". I think this probably limits this example to Win95 only, Sorry. This code was written as a test for another of my projects ( a C&C savegame organizer) and at the moment it will extract the files from a zip file and then search for files that are relevant to playing C&C Chris Beach 100436.172@compuserve.com INCLUDED FILES README.TXT 'This file PROGLIST.TXT 'List of my other releases or upcoming programs PKUNZIP.PIF 'You can alter this to make the shelling suit your needs UNZIP.BAS 'Include this with any project you want to shell from UNZIP.FRM/FRX 'Test form files ZIP Testing.VBP 'Test project File ZIP Testing.EXE 'Compile project LEGAL AND OTHER STUFF A lot of this code is based on code and material in the Microsoft KB help files. I have adapted, fiddled, altered, and generaly played with the information in the files until I got the solution to my problem. Visual Basic, Windows 95 are trademarks of Microsoft Corp. The FindWindowLike function is also copyright of somebody at Microsoft PKUNZIP and PKZIP are copyrights of PKWare PKUNZIP Command Line Switches for reference Usage: PKUNZIP [options] zipfile [@list] [files...] -c[m] extract files to Console [with More] -d restore/create Directory structure stored in .ZIP file -e[c|d|e|n|p|r|s] Extract files. Sort by [CRC | Date | Extension | Name | Percentage | Reverse | Size] -f Freshen files in destination directory -j|J mask|don't mask files (def.=jhrs) -n extract only Newer files -o Overwrite previously existing files -p[a/b][c][#] extract to Printer [Asc mode,Bin mode,Com port] [port #] -q Enable ANSI comments -s[pwd] Decrypt with password [If no pwd is given, prompt for pwd] -t Test .ZIP file integrity -v[b][r][m][t] View .ZIP [Brief][Reverse][More][Technical] sort by [CRC| [c,d,e,n,o,p,s] Date|Extension|Name|natural Order(default)|Percentage|Size] -x eXclude file(s) from extraction -$ Restore volume label on destination drive -@listfile Generate list file -3 Disable 32-bit instruction usage on 80386 or higher CPU's -^ Echo the command line -+ Disable Expanded Memory (EMS) usage -- Disable UMB/HMA Memory (XMS) usage -) Disable 32 bit DPMI usage